/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.vsu.cs.piit.vokod.DAO;

import java.util.Date;
import java.util.List;
import org.hibernate.Query;
import ru.vsu.cs.piit.hibernate.GenericDAO.GenericHibernateDAO;
import ru.vsu.cs.piit.vokod.model.Pacient;

/**
 *
 * @author Галчонок
 */
public class PacientDAO extends GenericHibernateDAO<Pacient, Integer> {

    public List<Pacient> getListByDate(Date d1, Date d2)
    {
        String s = d1.toString();
        s = d2.toString();
        Query q = getSession().getNamedQuery("Pacient.findByDateOfDischarge")
                .setDate("dateOfDischarge1", d1)
                .setDate("dateOfDischarge2", d2);
        return q.list();
    }
}
